﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Text;
using ExtBusiness.Controls;
using System.Collections.Generic;
using ExtBusiness.Inspect;
using ExtBusiness;

public partial class MyWindow_suspendLogQuery : PageBase
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            BindData();
        }
    }

    /// <summary>
    /// 绑定数据
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void gvSerial_OnLoadData(object sender, EventArgs e)
    {
        BindData();
    }

    /// <summary>
    /// 数据列创建事件
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void gvSerial_RowCreated(object sender, GridViewRowEventArgs e)
    {
        switch (e.Row.RowType)
        {
            case DataControlRowType.Header:
                break;
            case DataControlRowType.DataRow:
                {
                    DataRowView dtr = (DataRowView)e.Row.DataItem;
                    if (dtr != null)
                    {
                    }
                }
                break;
        }
    }

    /// <summary>
    /// 绑定数据
    /// </summary>
    private void BindData()
    {
        string strStart = calStartData.Value;
        string strEnd = calEndData.Value;
        string iid = txtIID.Text;
        SuspendInfo suInfo = new SuspendInfo();
        DataTable dtSource = suInfo.GetSuspendLog(UserId, strStart, strEnd, iid);
        
        gvSerial.DataSource = dtSource;
        gvSerial.PageSize = SystemConfig.PageSize;
        gvSerial.RecordCount = dtSource.Rows.Count;
        gvSerial.DataBind();
    }

    
    #region 查询
    protected void btnQuery_Click(object sender, EventArgs e)
    {
        BindData();
    }
    #endregion
}
